<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="xm"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/base.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/cartList.css">
</head>
<script type="text/javascript">
function delCart(merId){
	alert("移除的商品id是："+merId);
	location.href='<%=request.getContextPath()%>/filter/cart?m=delCart&merId='+merId;
}
function clearCart(){
	if(confirm("您是否确定清空购物车")){
		location.href='<%=request.getContextPath()%>/filter/cart?m=clearCart';

	}
}
	function continueShop(){
		location.href='<%=request.getContextPath()%>/browseIndex';
	}
	function changeCart()
	{
		var price = document.getElementById("price").value;
		var number = document.getElementById("number").value;
		//alert( " " +price + number);
		//document.getElementById("money").innerHTML("2");
		document.getElementById("money").innerHTML="$"+price*number;
	}
	function confirmOrder(){
		location.href='<%=request.getContextPath()%>/html/cartConfirm.jsp';
	}
</script>
<body>
	 <div id="box">
		 <jsp:include page="/comm/header.jsp"></jsp:include>
		 <div id="main">
		 	 <div id="cartInfo">
		 	 	 <img alt="" src="../images/gouwuche3.gif" class="logoImg">
		 	 	 <div class="navList">
		 	 	 	<img alt=" "  src="../images/gouwuche5.gif" class="navSplace">
		 	 	 	<span class="navSplace img_blue">查看购物车物品</span>
		 	 	 	<img alt=" "  src="../images/Car_15.gif" class="navSplace img15">
		 	 	 	<img alt=" "  src="../images/tijiao2.gif" class="navSplace">
		 	 	 	<span class="navSplace img_gray">确认订单信息</span>
		 	 	 	<img alt=" "  src="../images/Car_15.gif" class="navSplace img15">
		 	 	 	<img alt=" "  src="../images/tijiao4.gif" class="navSplace">
		 	 	 	<span class="navSplace img_gray">订单提交成功</span>
		 	 	 	<img alt=" "  src="../images/Car_15.gif" class="navSplace img15">
		 	 	 </div>
		 	 	 <table>
		 	 	 	<tr class="bg_tr">
		 	 	 		<th>商品名称</th>
		 	 	 		<th>市场价</th>
		 	 	 		<th>会员价</th>
		 	 	 		<th>数量</th>
		 	 	 		
		 	 	 		<!-- 鞋码 -->
		 	 	 		<th>尺寸</th>
		 	 	 				
		 	 	 		<th>金额</th>
		 	 	 		<th>删除</th> 		 		
		 	 	 	 	 	 		

		 	 	 	</tr>
		 	 	 	<xm:forEach items="${cartSelectedMerList }" var="mer">
			 	 	 	<tr>
							<td><a href="#${mer.id }">${mer.merName}</a></td>
			 	 	 		<td>${mer.merPrice}</td>
			 	 	 		<td><input type="hidden" id ="price" value="${mer.price }">${mer.price }</td>
							<td><input type="text" value="${mer.number }" id="number" onkeyup="changeCart()"></td>
			 	 	 		
			 	 	 		<!-- 尺寸选择 -->
			 	 	 		<td>
				 	 	 		<select style="width:58px;height:22px">
								  <option value="36">36</option>
								  <option value="37">37</option>
								  <option value="38">38</option>
								  <option value="39">39</option>
								  <option value="40">40</option>
								  <option value="41">41</option>
								  <option value="42">42</option>
								  <option value="43">43</option>
								  <option value="44">44</option>
								  <option value="45">45</option>
								  
								</select>
			 	 	 		</td>
			 	 	 		
			 	 	 		<td id="money">${mer.money}</td>
			 	 	 		<td>
			 	 	 			<img alt="" src="../images/delete1.gif" onclick="delCart(${mer.id })">
			 	 	 		</td>
			 	 	 	</tr>
		 	 	 	
		 	 	 	</xm:forEach>
		 	 	 	
		 	 	 	<tr class="bg_tr">
		 	 	 		<td colspan="7">
		 	 	 			<img alt="" src="../images/me03.gif">
		 	 	 			总金额:${cartInfo.money}(不包含配送费)
		 	 	 		</td>
		 	 	 	</tr>
		 	 	 </table>
		 	 	 <div class="operatorDiv">
		 	 	 	<img alt="" src="../images/Car_icon_012.png" onclick="clearCart()">
		 	 	 	<img alt="" src="../images/Car_icon_013.png" onclick="continueShop()">
		 	 	 	<img alt="" src="../images/Car_icon_014.png" onclick="confirmOrder()">
		 	 	 </div>
		 	 </div>
		 </div>
		 <jsp:include page="/comm/footer.jsp"></jsp:include>
	 </div>
</body>
</html>